<!DOCTYPE html>






  


<html class="theme-next mist use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
<meta name="theme-color" content="#222">



  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">




  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />










  <meta name="baidu-site-verification" content="6hi01gkdPQ" />










  
  
  
  

  
    
    
  

  
    
      
    

    
  

  

  
    
      
    

    
  

  
    
      
    

    
  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Monda:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Lobster Two:300,300italic,400,400italic,700,700italic|PT Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=6.2.0" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.ico?v=6.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.ico?v=6.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.ico?v=6.2.0">


  <link rel="mask-icon" href="/images/logo.ico?v=6.2.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '6.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '995B6MOVEJ',
      apiKey: 'cc928ef862522d7631d991ac65f2ec92',
      indexName: 'imwangyu',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="公司的WebService服务端使用.NET生成，客户端需要使用Java来写，客户端代码如下：12345678910111213141516171819202122232425262728293031323334353637383940import org.apache.axiom.om.OMAbstractFactory;import org.apache.axiom.om.OMElement;">
<meta name="keywords" content="Java,Axis2,SOAPAction,.NET">
<meta property="og:type" content="article">
<meta property="og:title" content="Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法">
<meta property="og:url" content="http://wyu.space/2017/08/19/Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法/index.html">
<meta property="og:site_name" content="Sometimes Naive">
<meta property="og:description" content="公司的WebService服务端使用.NET生成，客户端需要使用Java来写，客户端代码如下：12345678910111213141516171819202122232425262728293031323334353637383940import org.apache.axiom.om.OMAbstractFactory;import org.apache.axiom.om.OMElement;">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2018-04-30T16:40:14.112Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法">
<meta name="twitter:description" content="公司的WebService服务端使用.NET生成，客户端需要使用Java来写，客户端代码如下：12345678910111213141516171819202122232425262728293031323334353637383940import org.apache.axiom.om.OMAbstractFactory;import org.apache.axiom.om.OMElement;">



  <link rel="alternate" href="/atom.xml" title="Sometimes Naive" type="application/atom+xml" />




  <link rel="canonical" href="http://wyu.space/2017/08/19/Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法/"/>



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法 | Sometimes Naive</title>
  






  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?405d001d8bd35d058cc9251901c71aa6";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
	
	<a href="https://github.com/imwangyu"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
	
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Sometimes Naive</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>




<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-about">
    <a href="/about/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">
    <a href="/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />标签</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">
    <a href="/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br />分类</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-commonweal">
    <a href="/404.html" rel="section">
      <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />公益 404</a>
  </li>

      
      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />搜索</a>
        </li>
      
    </ul>
  

  
    

  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  
    <div class="reading-progress-bar"></div>
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://wyu.space/2017/08/19/Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="王宇">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sometimes Naive">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2017-08-19 14:24:46" itemprop="dateCreated datePublished" datetime="2017-08-19T14:24:46+08:00">2017-08-19</time>
            

            
              

              
                
                <span class="post-meta-divider">|</span>
                

                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2018-05-01 00:40:14" itemprop="dateModified" datetime="2018-05-01T00:40:14+08:00">2018-05-01</time>
              
            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/解决方法/" itemprop="url" rel="index"><span itemprop="name">解决方法</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="post-meta-item-icon"
            >
            <i class="fa fa-eye"></i>
             热度： 
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
			<span>℃</span>
            </span>
          

          
            <div class="post-symbolscount">
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">本文字数：</span>
                
                <span title="本文字数">4.7k</span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">4 分钟</span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>公司的WebService服务端使用.NET生成，客户端需要使用Java来写，客户端代码如下：<br><figure class="highlight actionscript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div></pre></td><td class="code"><pre><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMAbstractFactory;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMElement;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMFactory;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMNamespace;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.AxisFault;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.addressing.EndpointReference;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.client.Options;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.client.ServiceClient;</span></div><div class="line"></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> java.rmi.RemoteException;</span></div><div class="line"></div><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Axis2Test</span></span></div><div class="line"><span class="class"></span>&#123;</div><div class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> main(String[] args) throws RemoteException &#123;</div><div class="line">        test();</div><div class="line">    &#125;</div><div class="line"></div><div class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> test() throws AxisFault &#123;</div><div class="line">        <span class="keyword">try</span> &#123;</div><div class="line">            String url = <span class="string">"目标URL"</span>;</div><div class="line">            Options options = <span class="keyword">new</span> Options();</div><div class="line">            EndpointReference targetEPR = <span class="keyword">new</span> EndpointReference(url);</div><div class="line">            options.setTo(targetEPR);</div><div class="line">            ServiceClient sender = <span class="keyword">new</span> ServiceClient();</div><div class="line">            sender.setOptions(options);</div><div class="line">            OMFactory fac = OMAbstractFactory.getOMFactory();</div><div class="line">            String tns = <span class="string">"目标的TargetNameSpace"</span>;</div><div class="line">            OMNamespace omNs = fac.createOMNamespace(tns, <span class="string">""</span>);</div><div class="line">            OMElement method = fac.createOMElement(<span class="string">"调用的方法名"</span>, omNs);</div><div class="line">            OMElement symbol = fac.createOMElement(<span class="string">"参数名"</span>, omNs);</div><div class="line">            symbol.addChild(fac.createOMText(symbol, <span class="string">"参数值"</span>));</div><div class="line">            method.addChild(symbol);</div><div class="line">            method.build();</div><div class="line">            OMElement result = sender.sendReceive(method);</div><div class="line">            System.out.println(result);</div><div class="line">        &#125; <span class="keyword">catch</span> (AxisFault axisFault) &#123;</div><div class="line">            axisFault.printStackTrace();</div><div class="line">        &#125;</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>在运行这段代码时出现了如下错误：</p>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line">org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.AxisFault</span>: System<span class="selector-class">.Web</span><span class="selector-class">.Services</span><span class="selector-class">.Protocols</span><span class="selector-class">.SoapException</span>: 服务器未能识别 HTTP 头 SOAPAction 的值: 。</div><div class="line">   在 System<span class="selector-class">.Web</span><span class="selector-class">.Services</span><span class="selector-class">.Protocols</span><span class="selector-class">.Soap11ServerProtocolHelper</span><span class="selector-class">.RouteRequest</span>()</div><div class="line">   在 System<span class="selector-class">.Web</span><span class="selector-class">.Services</span><span class="selector-class">.Protocols</span><span class="selector-class">.SoapServerProtocol</span><span class="selector-class">.RouteRequest</span>(SoapServerMessage message)</div><div class="line">   在 System<span class="selector-class">.Web</span><span class="selector-class">.Services</span><span class="selector-class">.Protocols</span><span class="selector-class">.SoapServerProtocol</span><span class="selector-class">.Initialize</span>()</div><div class="line">   在 System<span class="selector-class">.Web</span><span class="selector-class">.Services</span><span class="selector-class">.Protocols</span><span class="selector-class">.ServerProtocol</span><span class="selector-class">.SetContext</span>(Type type, HttpContext context, HttpRequest request, HttpResponse response)</div><div class="line">   在 System<span class="selector-class">.Web</span><span class="selector-class">.Services</span><span class="selector-class">.Protocols</span><span class="selector-class">.ServerProtocolFactory</span><span class="selector-class">.Create</span>(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.util</span><span class="selector-class">.Utils</span><span class="selector-class">.getInboundFaultFromMessageContext</span>(Utils<span class="selector-class">.java</span>:<span class="number">508</span>)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.description</span><span class="selector-class">.OutInAxisOperationClient</span><span class="selector-class">.handleResponse</span>(OutInAxisOperation<span class="selector-class">.java</span>:<span class="number">368</span>)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.description</span><span class="selector-class">.OutInAxisOperationClient</span><span class="selector-class">.send</span>(OutInAxisOperation<span class="selector-class">.java</span>:<span class="number">414</span>)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.description</span><span class="selector-class">.OutInAxisOperationClient</span><span class="selector-class">.executeImpl</span>(OutInAxisOperation<span class="selector-class">.java</span>:<span class="number">225</span>)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.client</span><span class="selector-class">.OperationClient</span><span class="selector-class">.execute</span>(OperationClient<span class="selector-class">.java</span>:<span class="number">150</span>)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.client</span><span class="selector-class">.ServiceClient</span><span class="selector-class">.sendReceive</span>(ServiceClient<span class="selector-class">.java</span>:<span class="number">533</span>)</div><div class="line">	at org<span class="selector-class">.apache</span><span class="selector-class">.axis2</span><span class="selector-class">.client</span><span class="selector-class">.ServiceClient</span><span class="selector-class">.sendReceive</span>(ServiceClient<span class="selector-class">.java</span>:<span class="number">509</span>)</div><div class="line">	at Axis2Test.test(Axis2Test<span class="selector-class">.java</span>:<span class="number">34</span>)</div><div class="line">	at Axis2Test.main(Axis2Test<span class="selector-class">.java</span>:<span class="number">15</span>)</div></pre></td></tr></table></figure>
<p>经过查找之后发现JAX-WS规范不需要SoapAction，但是.NET需要，所以产生了这个错误。<br>在上网查找了之后发现可以在option对象下添加一个属性：</p>
<figure class="highlight apache"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attribute"><span class="nomarkup">options</span></span>.setAction(<span class="string">"目标的TargetNameSpace"</span>+<span class="string">"调用的方法名"</span>);</div></pre></td></tr></table></figure>
<p>添加后代码为：</p>
<figure class="highlight actionscript"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div></pre></td><td class="code"><pre><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMAbstractFactory;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMElement;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMFactory;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axiom.om.OMNamespace;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.AxisFault;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.addressing.EndpointReference;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.client.Options;</span></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> org.apache.axis2.client.ServiceClient;</span></div><div class="line"></div><div class="line"><span class="meta"><span class="meta-keyword">import</span> java.rmi.RemoteException;</span></div><div class="line"></div><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Axis2Test</span></span></div><div class="line"><span class="class"></span>&#123;</div><div class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> main(String[] args) throws RemoteException &#123;</div><div class="line">        test();</div><div class="line">    &#125;</div><div class="line"></div><div class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> test() throws AxisFault &#123;</div><div class="line">        <span class="keyword">try</span> &#123;</div><div class="line">            String url = <span class="string">"目标URL"</span>;</div><div class="line">            Options options = <span class="keyword">new</span> Options();</div><div class="line">            EndpointReference targetEPR = <span class="keyword">new</span> EndpointReference(url);</div><div class="line">            options.setTo(targetEPR);</div><div class="line">            options.setAction(<span class="string">"目标的TargetNameSpace"</span>+<span class="string">"调用的方法名"</span>);<span class="comment">//需要加上这条语句</span></div><div class="line">            ServiceClient sender = <span class="keyword">new</span> ServiceClient();</div><div class="line">            sender.setOptions(options);</div><div class="line">            OMFactory fac = OMAbstractFactory.getOMFactory();</div><div class="line">            String tns = <span class="string">"目标的TargetNameSpace"</span>;</div><div class="line">            OMNamespace omNs = fac.createOMNamespace(tns, <span class="string">""</span>);</div><div class="line">            OMElement method = fac.createOMElement(<span class="string">"调用的方法名"</span>, omNs);</div><div class="line">            OMElement symbol = fac.createOMElement(<span class="string">"参数名"</span>, omNs);</div><div class="line">            symbol.addChild(fac.createOMText(symbol, <span class="string">"参数值"</span>));</div><div class="line">            method.addChild(symbol);</div><div class="line">            method.build();</div><div class="line">            OMElement result = sender.sendReceive(method);</div><div class="line">            System.out.println(result);</div><div class="line">        &#125; <span class="keyword">catch</span> (AxisFault axisFault) &#123;</div><div class="line">            axisFault.printStackTrace();</div><div class="line">        &#125;</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>修改后信息返回成功</p>

      
    </div>

    
	
	<div>
      
      <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>
      
    </div>

    
    
    
	
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.jpg" alt="王宇 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.jpg" alt="王宇 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>王宇</li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="http://wyu.space/2017/08/19/Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法/" title="Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法">http://wyu.space/2017/08/19/Axis2 服务器未能识别 HTTP 头 SOAPAction 的值 的解决办法/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明出处！</li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Java/" rel="tag"><i class="fa fa-tag"></i> Java</a>
          
            <a href="/tags/Axis2/" rel="tag"><i class="fa fa-tag"></i> Axis2</a>
          
            <a href="/tags/SOAPAction/" rel="tag"><i class="fa fa-tag"></i> SOAPAction</a>
          
            <a href="/tags/NET/" rel="tag"><i class="fa fa-tag"></i> .NET</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div id="needsharebutton-postbottom">
            <span class="btn">
              <i class="fa fa-share-alt" aria-hidden="true"></i>
            </span>
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/08/19/通过反射来实现List转为JSON/" rel="next" title="通过反射来实现List转为JSON">
                <i class="fa fa-chevron-left"></i> 通过反射来实现List转为JSON
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/08/25/字符串的最长不重复子串/" rel="prev" title="字符串的最长不重复子串">
                字符串的最长不重复子串 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zNjE0NS8xMjY4MA=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/avatar.jpg"
                alt="王宇" />
            
              <p class="site-author-name" itemprop="name">王宇</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">10</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">7</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">18</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://wangshifu.net.cn" title="Wong" target="_blank">Wong</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://pvitlzp.cn" title="刘志鹏" target="_blank">刘志鹏</a>
                  </li>
                
              </ul>
            </div>
          

          
            
          
          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2018</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">王宇</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">站点总字数：</span>
    
    <span title="站点总字数">29k</span>
  

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    
    <span title="站点阅读时长">26 分钟</span>
  
</div>




  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动 v3.3.8</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/theme-next/hexo-theme-next">NexT.Mist</a> v6.2.0</div>



        
<div class="busuanzi-count">
  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv" title="总访客量">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
    </span>
  

  
    <span class="site-pv" title="总访问量">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
    </span>
  
</div>









        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    
      <div id="needsharebutton-float">
        <span class="btn">
          <i class="fa fa-share-alt" aria-hidden="true"></i>
        </span>
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>














  











  



  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  

  
  
    <script type="text/javascript" src="/lib/reading_progress/reading_progress.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.2.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.2.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.2.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.2.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.2.0"></script>



  



	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  










  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=6.2.0"></script>



  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  
  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>

  <script>
    
      pbOptions = {};
      
          pbOptions.iconStyle = "box";
      
          pbOptions.boxForm = "horizontal";
      
          pbOptions.position = "bottomCenter";
      
          pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
      flOptions = {};
      
          flOptions.iconStyle = "box";
      
          flOptions.boxForm = "horizontal";
      
          flOptions.position = "bottomLeft";
      
          flOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-float', flOptions);
    
  </script>

  

  

  

  

  
  
  
  <script src="/lib/bookmark/bookmark.min.js?v=1.0"></script>
  <script type="text/javascript">
  
    bookmark.scrollToMark('auto', "#更多");
  
  </script>


  

  
  <!-- 页面点击小红心 -->
  <script type="text/javascript" src="/js/src/love.js"></script>
</body>
</html>
